using System;
using System.Diagnostics;
using Microsoft.VisualStudio.TestPlatform.UnitTestFramework;
using XcoAppSpaces.Core.Ports;

namespace test.XcoAppSpaces.Core
{
	[TestClass]
	public class testErrorReproduction
	{
		[TestMethod]
		public void Receive_with_timeout_throws_exception()
		{
			//reproduction of error that no receive timeout is thrown - seems to be a problem with using "await" (current ports version doesn't use it anymore)
			var port = new Port<string> ();
			Assert.ThrowsException<AggregateException>(() =>
			{
				var result = port.Receive(1000).Result;
			});
		}
	}
}

